package com.wust.demo1.action;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;

public class JFreeChartDemoAction {
	private JFreeChart chart;
	public String showJFreeChart(){
		DefaultPieDataset data = new DefaultPieDataset();
		data.setValue("Java", new Double(43.2));
		data.setValue("Visual Basic",new Double(1.0));
		data.setValue("C/C++", new Double(17.5));
		chart = ChartFactory.createPieChart("Pie Chart", data, true, true,false);
		return "success";
	}
	public JFreeChart getChart() {
		return chart;
	}
	public void setChart(JFreeChart chart) {
		this.chart = chart;
	}

}
